﻿using Basic.FlowRemoteModel.NodeMsg;
using Basic.FlowRemoteModel.NodeMsg.Model;
using Basic.FlowService.Interface;
using WeDonekRpc.Client.Interface;

namespace Basic.FlowService.RpcEvent
{
    internal class NodeMsgEvent : IRpcApiService
    {
        private readonly IFlowNodeMsgService _Service;

        public NodeMsgEvent ( IFlowNodeMsgService service )
        {
            this._Service = service;
        }
        public FlowNodeMsgData GetFlowNodeMsg ( GetFlowNodeMsg obj )
        {
            return this._Service.Get(obj.Id);
        }
        public FlowNodeMsg[] GetFlowNodeMsgs ( GetFlowNodeMsgs obj )
        {
            return this._Service.Gets(obj.NodeId);
        }
        public void DeleteFlowNodeMsg ( DeleteFlowNodeMsg obj )
        {
            this._Service.Delete(obj.Id);
        }
        public bool SetFlowNodeMsg ( SetFlowNodeMsg obj )
        {
            return this._Service.Set(obj.Id, obj.Datum);
        }
        public void AddFlowNodeMsg ( AddFlowNodeMsg obj )
        {
            this._Service.Add(obj.Datum);
        }
    }
}
